<?php
$sql="select * from 10_exportqueue where status=0 limit 1";
$row=Db::G()->GetRow($sql);
if (empty($row)) exit();
OT("->$row[user],$row[bd],$row[ed]");
mod::Load(10);
$export = new Exporter();
$rtv=$export->run($row['name'],$row['bd'],$row['ed']);
OT("->$rtv[path]");

$path=$rtv[path];
$id=$row[id];
OT("->$id");

$sql="update 10_exportqueue set status=1,path='$path' where id=$id";
OT("->$sql");
$num=Db::G()->Exec($sql);
OT("->$num");